<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="flex-box">
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img
        class="outline-parent-bg"
        :src="publicUrls + 'free/style6/Level2outlineStyle5Bg.webp'"
        alt=""
      />
      <div class="outline border-hover-style">
        <div class="outline-content" :style="!props.info.remarks && !props.info.value && { justifyContent: 'center' }">
          <div class="content-tiitle">
            <div class="text-box" v-html="textType(props.info.text)"></div>
          </div>
          <p class="outline-subTitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
          <div class="outline-cover" v-if="props.info.value">
            <img
              @click="ImgVisible = true"
              :src="urls + props.info.value + '?imageView2/3/w/600/h/600/format/webp'"
              alt=""
            />
          </div>
          <TextMax
            v-if="props.domShow"
            :class="!props.info.value && !props.info.subTitle && 'remarksMargin'"
            :data="props.info.remarks"
            :title="props.info.text"
            :row="props.info.value ? 7 : 12"
          ></TextMax>
        </div>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free6Style5',
});
</script>

<script setup lang="ts">
import { publicUrls, textType } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style6.vue';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-right: 280px;
}
.flex-box {
  width: 438px;
  height: 774px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.outline {
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding-right: 11px;
}
.outline-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 288px;
  height: 100%;
  padding-top: 106px;
  padding-bottom: 114px;
}
.content-tiitle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-bottom: 10px;
  .text-box {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    ::v-deep p {
      font-family: SourceHanSerifCN-Bold;
      font-size: 24px;
      line-height: 32px;
      text-align: center;
      color: #737d87;
    }
  }
}
.outline-subTitle {
  width: 100%;
  text-align: center;
  font-family: SourceHanSerifCN;
  font-size: 18px;
  line-height: 28px;
  text-align: center;
  margin-bottom: 10px;
  color: #686763;
}
.remarksMargin {
  margin-top: 10px;
}
.outline-cover {
  width: 100%;
  flex: 1;
  max-height: 480px;
  margin-bottom: 10px;
  background: rgba(222, 217, 211, 0.5);
  overflow: hidden;
  &:hover img {
    transform: scale(1.2);
  }
  img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
  }
}

.Showroom-parent {
  width: 50px;
  height: 50px;
  object-fit: contain;
  position: absolute;
  top: 44px;
  right: 200px;
  z-index: 21;
}
::v-deep .van-text-ellipsis {
  font-family: PingFang SC !important;
  font-size: 16px !important;
  color: #686763 !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: #737d87 !important;
  font-weight: 800 !important;
}
::v-deep .t-popup__content {
  background: #56677b;
  padding: 2px 12px;
  font-family: 'Microsoft YaHei';
  font-size: 13px;
  line-height: 20px;
  color: #f1efea;
  box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);
  margin-top: 6px !important;
}
::v-deep .t-popup__arrow::before {
  background: #56677b;
  border: none;
  box-shadow: none !important;
}
</style>